package com.chain.BrotherExchange.widget.transformer;

import android.view.View;

import com.chain.BrotherExchange.widget.GalleryLayoutManager;

public class ScaleTransformer implements GalleryLayoutManager.ItemTransformer {

    @Override
    public void transformItem(GalleryLayoutManager layoutManager, View item, float fraction) {
        item.setPivotX(item.getWidth() / 2f);
        item.setPivotY(item.getHeight() / 2f);
        item.setScaleX(1 - 0.01f * Math.abs(fraction));
        item.setScaleY(1 - 0.15f * Math.abs(fraction));
    }
}
